<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.drawing.text.js" ></script>
    <script src="../libraries/RGraph.pie.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->

    <title>A Donut chart showing percent complete</title>
    
    <meta name="description" content="A Donut chart showing percent complete" />
    <meta name="robots" content="noindex,nofollow" />
     
</head>
<body>

    <h1>A Donut chart showing percent complete</h1>

    <canvas id="cvs" width="450" height="450">[No canvas support]</canvas>
    
    <script>
        $(document).ready(function ()
        {
            var target = 73;
            var increment = 2

            var donut = new RGraph.Pie({
                id: 'cvs',
                data: [target,27],
                options: {
                    variant: 'donut',
                    colors: ['green','rgba(0,0,0,0)'],
                    strokestyle: 'rgba(0,0,0,0)'
                }
            }).on('draw', function (obj)
            {
                // Update the text object with the value shown on the Donut chart
                if (text) {
                    text.text = parseInt(target * obj.get('effect.roundrobin.multiplier')) + '%';
                }
            }).roundRobin()
    
    
    
    
            var text = new RGraph.Drawing.Text({
                id: 'cvs',
                x: donut.centerx,
                y: donut.centery,
                text: '0%',
                options: {
                    size: 52,
                    halign: 'center',
                    valign: 'center'
                }
            }).draw()
        })
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>